package com.ziyuan.pojo;


import com.ziyuan.State.State;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Article {
    @NotNull(groups =updateGroup.class )
    private Integer id;//主键ID
    @NotEmpty
    private String title;//文章标题
        @NotEmpty
        private String content;//文章内容
        @NotEmpty
    private String coverImg;//封面图像
    @State
    private String state;//发布状态 已发布|草稿
    @NotNull
    private Integer categoryId;//分类ID
    private Integer createUser;//创建人ID
    private LocalDateTime createTime;//创建时间
    private LocalDateTime updateTime;//更新时间
//为Article类定义两个内部接口，用于定义验证组

//    public interface addGroup extends Default{
//
//    }
//    public interface updateGroup extends Default{
//
//    }
//    为Article类定义两个内部接口，用于定义验证组
    public interface addGroup {

    }
    public interface updateGroup {

    }

}
